package com.autoagent.ai_live_master.scriptRecommendation.Enum;

import lombok.Getter;

@Getter
public enum AbnormalMetricEnum {
    INLINE_PEOPLE("inlinePeople", "进线人数"),
    ONLINE_CHANGES("onlineChanges", "在线变化"),
    TRADED_ORDERS("tradedOrders", "成交单数"),
    CLICK_THROUGH_RATE("clickThroughRate", "非主推商品点击数比例"),
    CONVERSION_RATIO("conversionRatio", "非主推商品转化数比例");

    private final String id;
    private final String label;

    AbnormalMetricEnum(String id, String label) {
        this.id = id;
        this.label = label;
    }

    public static AbnormalMetricEnum fromId(String id) {
        for (AbnormalMetricEnum e : values()) {
            if (e.id.equals(id)) {
                return e;
            }
        }
        throw new IllegalArgumentException("无效指标ID：" + id);
    }
}

